﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AwesomeSlider.Models;

namespace AwesomeSlider.Extensions
{
    public static class UrlHelperAdminExtensions
    {
        public static string SliderSummary(this UrlHelper urlHelper)
        {
            return urlHelper.Action("Summary", "SlidersAdmin", new { area = "AwesomeSlider" });
        }

        public static string SliderCreate(this UrlHelper urlHelper)
        {
            return urlHelper.Action("Create", "SlidersAdmin", new { area = "AwesomeSlider" });
        }

        public static string SliderItem(this UrlHelper urlHelper, SliderPart sliderPart)
        {
            return urlHelper.Action("Item", "SlidersAdmin", new { sliderId = sliderPart.Id, area = "AwesomeSlider" });
        }

        public static string SliderItemAdd(this UrlHelper urlHelper, SliderPart sliderPart)
        {
            return urlHelper.Action("Add", "SliderItemAdmin", new { sliderId = sliderPart.Id, area = "AwesomeSlider" });
        }

        public static string SliderRemove(this UrlHelper urlHelper, SliderPart sliderPart, bool deleteFolder)
        {
            return urlHelper.Action("RemoveSlider", "SlidersAdmin", new { sliderId = sliderPart.Id, deleteFolder = deleteFolder, area = "AwesomeSlider" });
        }

        public static string SliderEdit(this UrlHelper urlHelper, SliderPart sliderPart)
        {
            return urlHelper.Action("Edit", "SlidersAdmin", new { albumId = sliderPart.Id, area = "AwesomeSlider" });
        }

        public static string SliderItemUpload(this UrlHelper urlHelper, SliderPart sliderPart)
        {
            return urlHelper.Action("UploadFile", "SliderItemAdmin", new { sliderId = sliderPart.Id, area = "AwesomeSlider" });
        }

        public static string SliderItemEdit(this UrlHelper urlHelper, SliderItemPart sliderItemPart)
        {
            return urlHelper.Action("Edit", "SliderItemAdmin", new { sliderItemId = sliderItemPart.Id, area = "AwesomeSlider" });
        }

        public static string SliderItemRemove(this UrlHelper urlHelper, int sliderItemId, bool deleteFile)
        {
            return urlHelper.Action("Remove", "SliderItemAdmin", new { sliderItemId = sliderItemId, deleteFile = deleteFile, area = "AwesomeSlider" });
        }

        public static string SliderItem(this UrlHelper urlHelper, int sliderId)
        {
            return urlHelper.Action("Item", "PhotoAlbumAdmin", new { sliderId = sliderId, area = "AwesomeSlider" });
        }

    }

    public static class UrlHelperhandlingExtensions
    {
        public static string Thumb(this UrlHelper urlHelper, int sliderItemId, int width, int height)
        {
            return urlHelper.Action("Thumb", "SliderItemHandling", new
            {
                photoId = sliderItemId,
                width = width,
                height = height,
                area = "AwesomeSlider"
            });
        }
    }
}